package org.gc.webapp.action.register;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.gc.service.security.UserService;
import org.gc.webapp.action.BaseAction;


public class ResetPasswordAction extends BaseAction{
	 private UserService userService;
	 private String username;
	 private String email;
	 public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public void setUserService(UserService userService) {
	        this.userService = userService;
	    }
	@Action(value = "resetPassword", results = { @Result(name = "input", location = "findPassword-fail.jsp"),
			@Result(name = "success", location = "findPassword-success.jsp")})
    public String resetPassword(){
		return userService.resetPassword(username, email)== true? SUCCESS:INPUT ;
        
    }  
}
